package com.sx.pipeline.ui.task.evaluate

import android.widget.RatingBar
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hjq.widget.layout.SettingBar
import com.hjq.widget.view.SimpleRatingBar
import com.sx.pipeline.R
import com.sx.pipeline.repos.http.res.TaskEvaluateVO

/**
 * @Author：YY
 * @Date：2022/2/10
 * @Describe: 任务评价类别适配器
 */
class TaskEvaluateAdapter(
) : BaseQuickAdapter<TaskEvaluateVO, BaseViewHolder>(
    R.layout.item_task_evaluate
) {
    override fun convert(holder: BaseViewHolder, item: TaskEvaluateVO) {
        val sbName=holder.getView<SettingBar>(R.id.sb_unit_name)
        sbName.rightText=item.unitName
        val ratingBar=holder.getView<SimpleRatingBar>(R.id.rc_rating_bar)
        ratingBar.grade=item.star.toFloat()
        ratingBar.isEnabled=false
        holder.setText(R.id.tv_time,item.createTime)
        holder.setText(R.id.tv_content,item.content)

    }
}